import React, { useEffect } from 'react'
import EchartsReact from "echarts-for-react"
export default function Topone(props) {
  
  const color=props.color
  const option = {
    color: `${color}`,
    tooltip: {
      trigger: 'axis'
    },
    legend: {
      data: ['Java', 'C', 'C++', 'python', 'VB', 'C#','JavaScript','PHP','SQL','Object-C',],
      textStyle:{
        color : 'white'
      },
    },
    grid: {
      left: '3%',
      right: '4%',
      bottom: '3%',
      containLabel: true
    },
    toolbox: {
      show : false
    },
    xAxis: {
      type: 'category',
      boundaryGap: false,
      data: ['1989', '1994', '1999', '2004', '2009', '2014', '2019']
    },
    yAxis: {
      type: 'value'
    },
    series: [
      {
        name: 'Java',
        type: 'line',
        stack: 'Total',
        data: [120, 132, 101, 134, 90, 230, 210]
      },
      {
        name: 'C',
        type: 'line',
        stack: 'Total',
        data: [220, 182, 191, 234, 290, 330, 310]
      },
      {
        name: 'C++',
        type: 'line',
        stack: 'Total',
        data: [150, 232, 201, 154, 190, 330, 410]
      },
      {
        name: 'python',
        type: 'line',
        stack: 'Total',
        data: [320, 332, 301, 334, 390, 330, 320]
      },
      {
        name: 'VB',
        type: 'line',
        stack: 'Total',
        data: [820, 932, 901, 934, 1290, 1330, 1320]
      },
      {
        name: 'C#',
        type: 'line',
        stack: 'Total',
        data: [820, 932, 901, 934, 1000, 900, 1000]
      },
      {
        name: 'JavaScript',
        type: 'line',
        stack: 'Total',
        data: [1000, 932, 901, 934, 1590, 1530, 1320]
      },
      {
        name: 'PHP',
        type: 'line',
        stack: 'Total',
        data: [1000, 932, 901, 934, 190, 1130, 1320]
      },
      {
        name: 'SQL',
        type: 'line',
        stack: 'Total',
        data: [820, 932, 901, 934, 1090, 1330, 1020]
      },
      {
        name: 'Object-C',
        type: 'line',
        stack: 'Total',
        data: [1220, 932, 901, 934, 1290, 1030, 1320]
      },
    ]
  };
  return (
    <EchartsReact style={{height:"100%",width:"100%"}} option={option} />
  )
}
